/*
 * This file (AxStdLogListener.java) is protected by the GNU GPL licence (v2). 
 * Please read the license.txt attached for further informations. 
 * 
 */

package artx.listeners;

import artx.events.AxLogEvent;
import artx.utils.AxConstants;

/**
 * Standard log listener using System's standard outputs to display all log
 * messages.
 * 
 * @author Xavier Gouchet
 * 
 */
public class AxStdLogListener implements AxLogListener, AxConstants {

	/**
	 * @see artx.listeners.AxLogListener#messageRegistered(artx.events.AxLogEvent)
	 */
	public void messageRegistered(AxLogEvent e) {
		if (e.GetLevel() <= LVL_ERROR) {
			System.err.println(e.GetMessage());
		} else {
			System.out.println(e.GetMessage());
		}
	}

	/**
	 * @see artx.listeners.AxLogListener#debugMessageRegistered(artx.events.AxLogEvent)
	 */
	public void debugMessageRegistered(AxLogEvent e) {
		System.out.println(e.GetMessage());
	}

}
